<template>
  <div id="app">
   <!-- 表格绘画 -->
   <router-view></router-view>
    <!-- <Loading v-if="isAjax"></Loading> -->
    <Spin fix v-if="isAjax" class="loading" size="large"></Spin>
  </div>
</template>

<script>
import Loading from "%/template/loading";
export default {
  name: "app",
  components: { Loading },
  created() {
    window._PAGE_FORX = this.$root;
    let tmp = window.localStorage.userInfo;
    if (this.$route.name == "login") {
      this.$router.push({
        name: "folder",
        params: {
          fid: "root"
        }
      });
    }
    try {
      let user = JSON.parse(tmp);
    } catch (error) {
      // if (this.$route.name != "login")
      this.$router.push({ name: "login" });
    }
  },
  computed: {
    isAjax() {
      let is = this.$root.bus.page.isAjax;
      return is;
    }
  }
};
</script>

<style>
body {
  margin: 0;
  padding: 0;
}
#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
}
.loading {
  z-index: 20000;
}
</style>
